package com.example.mobile2021606128wje0415;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
    RecyclerView ry_main_people;
    String[] name={"丁运生","方华高","朱云贵","庄伦鹏","杨文","朱元元","林丽璇","张伟","林晓莹","黄泽敏"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ry_main_people =findViewById(R.id.ry_main_people);
        ry_main_people.setLayoutManager(new LinearLayoutManager(this));
        //使用适配器
        peopleAdapter adapter = new peopleAdapter(name);
        //把控件传给适配器
        ry_main_people.setAdapter(adapter);

    }
}